import { createSlice, PayloadAction } from '@reduxjs/toolkit';

interface activityState {
    activityDetail: any;
    ticketDetail: any,
    activityOrderDetail: any,
    orderDetailByItem: any,
}

const initialState: activityState = {
    activityDetail: {},
    ticketDetail: {},
    activityOrderDetail: {},
    orderDetailByItem: {},
};

const activityDetailSlice = createSlice({
    name: 'activityDetail',
    initialState,
    reducers: {
        setActivityDetailStore(state, action) {
            state.activityDetail = action.payload.activityDetail;
        },
        selectTicketDetail(state, action) {
            state.ticketDetail = action.payload.ticketDetail;
        },
        setActivityOrderDetail(state, action) {
            state.activityOrderDetail = action.payload.activityOrderDetail;
        },
        setOrderDetailByItem(state, action) {
            state.orderDetailByItem = action.payload.orderDetailByItem;
        },
    },
});

export const { setOrderDetailByItem, setActivityDetailStore, selectTicketDetail, setActivityOrderDetail } = activityDetailSlice.actions;
export default activityDetailSlice.reducer;
